<!--
 * @Author: your name
 * @Date: 2020-11-24 12:17:18
 * @LastEditTime: 2020-11-24 14:56:22
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \solax-design\src\views\adminInverter\adminInverter.vue
-->
<template>
    <div class="adminInverter-main-box">
        <div class="search-box">
            <div class="search-box-sub">
                <span class="lable-text">区域</span>
                <el-select v-model="manufacturerId" filterable placeholder="请选择" clearable>
                    <el-option
                    v-for="item in selectDataList"
                    :key="item.code"
                    :label="item.enName"
                    :value="item.enName">
                    </el-option>
                </el-select>
            </div>
            <div class="search-box-sub">
                <span class="lable-text">国家</span>
                <el-select v-model="manufacturerId" filterable placeholder="请选择" clearable>
                    <el-option
                    v-for="item in selectDataList"
                    :key="item.code"
                    :label="item.enName"
                    :value="item.enName">
                    </el-option>
                </el-select>
            </div>
            <div class="search-box-sub">
                <span class="lable-text">城市</span>
                <el-input v-model="name" style="width:160px;" placeholder="请输入内容"></el-input>
            </div>
            <div class="search-box-sub">
                <el-button type="primary" @click='query'>查询</el-button>
            </div>
        </div>
        <div class="button-box">
            <el-button type="primary" icon='el-icon-plus' class="marginR10" @click="()=>{$router.push({path:'/addCity'})}">添加城市</el-button>
            <el-button type="primary" icon='el-icon-delete' class="marginR10" @click="()=>{$store.commit('setNewVisibleEdit',true)}">删除</el-button>
            <el-button type="primary" icon='el-icon-upload2' class="marginR10" @click="()=>{$store.commit('setNewVisible',true)}">导入</el-button>
        </div>
        <baseTable v-loading="loading"  row-key='sid' :data="dataRows" border  stripe   :column='column' :select='true' @selection-change="handleSelectionChange($event)" >
        </baseTable>
        <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="current"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
        </el-pagination>
    </div>
</template>

<script>
import baseTable from '../../components/common/baseTable'
export default {
    components: {
        baseTable
    },
    props: {

    },
    data() {
        return {
            manufacturerId:'',
            name:'',
            selectDataList:[],
            loading:false,
            dataRows:[],
            column:[{
                title: '区域',
                value: 'name',
            },
            {
                title: '国家',
                value: 'name',
            },{
                title: '城市',
                value: 'name',
            },
            {
                title: '经度',
                value: 'name',
            },
            {
                title: '纬度',
                value: 'name',
            }],
            size:10,
            current:1,
            total:1
        };
    },
    computed: {

    },
    watch: {

    },
    created() {

    },
    mounted() {

    },
    methods: {
        query(){
            
        },
        handleSelectionChange(val){
          console.log(val,'val');
          this.selectDataList=val.map( item=>{
            return item.sid
          })
        },
        handleSizeChange(val) {
          this.size = val
          this.current = 1
        },
        handleCurrentChange(val) {
          this.current = val
        },
    },
};
</script>

<style  lang="less" scoped>
.adminInverter-main-box{
    
}
</style>
